﻿using Microsoft.AspNetCore.Mvc;
using System;
using Wslzy.Auxiliary.Infrastructure.Helpers;
using Wslzy.Auxiliary.Web.Services.Interface;
using Wslzy.Auxiliary.Web.ViewModels;

namespace Wslzy.Auxiliary.Web.Controllers.System
{
    public class AccountController : Controller
    {
        private IAccountService service = Ioc.Create<IAccountService>();
        public IActionResult Index()
        {
            var result = service.GetAccounts();
            return View(result);
        }
        public IActionResult AddView()
        {
            return View();
        }
        public IActionResult Add(AccountVM accountVM)
        {
            var result = service.AddAccount(accountVM);
            return new JsonResult(result);
        }
    }
}